import pdfplumber
from openpyxl import Workbook
wb=Workbook()
ws=wb.active
f=pdfplumber.open('test.pdf')
for page in f.pages:
    tab=page.extract_table()
    if tab != None:
        for row in tab:
            ws.append(row)
wb.save('test.xlsx')
